﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;
using System.Net;
using System.IO;

using DreamCube.Foundation.Basic.Utility;

namespace Test
{
    class testPostData
    {
        public static void Test()
        {
            String url = "http://localhost:25751/Test3.web/TestUtility/testMyNetPostData.aspx";
            //Dictionary<String, String> nvc = new Dictionary<String, String>();
            //nvc.Add("id", "TTR");
            //nvc.Add("btn-submit-photo", "Upload");
            //MyNet.PostTo("http://localhost:25751/Test3.web/TestUtility/testMyNetPostData.aspx",
            //@"d:\a.png", "file", "image/jpeg", nvc);
            Image img = Image.FromFile(@"d:\a.png");
            //MyNet.PostTo(url, img, ImageFormat.Bmp);
            //Byte[] imgData = null;
            //using (MemoryStream ms = new MemoryStream())
            //{
            //    img.Save(ms, ImageFormat.Bmp);
            //    imgData = new Byte[ms.Length];
            //    ms.Read(imgData, 0, imgData.Length);
            //}
            //if (imgData != null)
            //{
            //    WebClient webClient = new WebClient();
            //    Stream s= webClient.OpenWrite(url);
            //    s.Write(imgData, 0, imgData.Length);
            //}
        }
    }
}
